package br.edu.ufcg.dsc.sig.geointerest;

public class BDConstantes {
	
	public static final String inserirPOI = "INSERT INTO poi (nome, endereco, dono, tipo, descricao, telefone, " +
											"ponto) VALUES (?,?,?,?,?,?,GeomFromText(?,?))"; 
	
	public static final String removerPOI = "DELETE FROM poi WHERE SRID = ?";
	
	public static final String editarPOI = "UPDATE poi SET nome=?, endereco=?, dono=?, tipo=?, descricao=?, " +
											"telefone=?, ponto=GeomFromText(?,?) WHERE SRID=?";
	
	public static final String recuperarTodosPOI = "SELECT AsText(ponto), srid, nome, endereco, dono, tipo, descricao, telefone FROM poi"; 

	public static final String darAvaliacao = "INSERT INTO avaliacao(id, dono, comentario, valor) VALUES (?,?,?,?)";
	
	public static final String getNota = "SELECT valor, dono FROM avaliacao WHERE id = ?";
	
	public static final String getComentario = "SELECT comentario, dono FROM avaliacao WHERE id = ?";
	
	
	// CONSULTAS ESPACIAIS
	
	public static final String pesquisaPorFiltro = "SELECT AsText(ponto), srid, nome, endereco, dono, tipo, descricao, telefone " +
											 	 "FROM poi WHERE ";

	public static final String getMediaNota = "(SELECT AVG(valor) FROM avaliacao WHERE id = srid)";

	
	
	
}
